home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr09 / vstsrc.zip / VSTEXTRN.H < prev    next >
C/C++ Source or Header  |  1995-01-30  |  14KB  |  299 lines

  1. #ifndef _VSTEXTRN_H
  2. #define _VSTEXTRN_H
  3. /*
  4.  * %W% %E% %U%  [EXTREL_1.2]
  5.  *
  6.  * VersaTrack orbit calculations are based on those that appear in Dr. Manfred
  7.  * Bester's sattrack program (the Unix(tm) versions 1 and 2).
  8.  *
  9.  * The data from which the maps where generated come from "xsat", an
  10.  * X-Windows program by David A. Curry (N9MSW).
  11.  *
  12.  * Site coordinates come from various sources, including a couple of
  13.  * World Almanacs, and also from both of the programs mentioned above.
  14.  *
  15.  * The following are authors' applicable copyright notices:
  16.  *
  17.  *                                                                               
  18.  * Copyright (c) 1992, 1993, 1994 Manfred Bester. All Rights Reserved.        
  19.  *                                                                           
  20.  * Permission to use, copy, modify, and distribute this software and its      
  21.  * documentation for educational, research and non-profit purposes, without   
  22.  * fee, and without a written agreement is hereby granted, provided that the  
  23.  * above copyright notice and the following three paragraphs appear in all    
  24.  * copies.                                                                    
  25.  *                                                                              
  26.  * Permission to incorporate this software into commercial products may be    
  27.  * obtained from the author, Dr. Manfred Bester, 1636 M. L. King Jr. Way,     
  28.  * Berkeley, CA 94709, USA.                                                   
  29.  *                                                                             
  30.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,  
  31.  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF    
  32.  * THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED   
  33.  * OF THE POSSIBILITY OF SUCH DAMAGE.                                         
  34.  *                                                                             
  35.  * THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT       
  36.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A    
  37.  * PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS"       
  38.  * BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,  
  39.  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS.                                   
  40.  *                                                                             
  41.  *                                                                             
  42.  * Copyright 1992 by David A. Curry                                            
  43.  *                                                                             
  44.  * Permission to use, copy, modify, distribute, and sell this software and its 
  45.  * documentation for any purpose is hereby granted without fee, provided that  
  46.  * the above copyright notice appear in all copies and that both that copyright
  47.  * notice and this permission notice appear in supporting documentation.  The  
  48.  * author makes no representations about the suitability of this software for  
  49.  * any purpose.  It is provided "as is" without express or implied warranty.   
  50.  *                                                                             
  51.  * David A. Curry, N9MSW                                                       
  52.  * Purdue University                                                           
  53.  * Engineering Computer Network                                                
  54.  * 1285 Electrical Engineering Building                                        
  55.  * West Lafayette, IN 47907                                                    
  56.  * davy@ecn.purdue.edu                                                         
  57.  *                                                                             
  58.  * VersaTrack Copyright (c) 1993, 1994 Siamack Navabpour. All Rights Reserved.
  59.  *
  60.  * Permission is hereby granted to copy, modify and distribute VersaTrack
  61.  * in whole, or in part, for educational, non-profit and non-commercial use
  62.  * only, free of charge or obligation, and without agreement, provided that
  63.  * all copyrights and restrictions noted herein are observed and followed, and
  64.  * additionally, that this and all other copyright notices listed herein
  65.  * appear unaltered in all copies and in all derived work.
  66.  *
  67.  * This notice shall not in any way void or supersede any of the other authors
  68.  * rights or privileges.
  69.  *
  70.  * VersaTrack IS PRESENTED FREE AND "AS IS", WITHOUT ANY WARRANTY OR SUPPORT.
  71.  * YOU USE IT AT YOUR OWN RISK. The author(s) shall not be liable for any
  72.  * direct, indirect, incidental, or consequential damage, loss of profits or
  73.  * other tangible or intangible losses or benefits, arising out of or related
  74.  * to its use. VersaTrack carries no warranty, explicit or implied, including
  75.  * but not limited to those of merchantablity and fitness for a particular
  76.  * purpose.
  77.  *
  78.  * Siamack Navabpour, 12342 Hunter's Chase Dr. Apt. 2114, Austin, TX 78729.
  79.  * sia@bga.com or sia@realtime.com.
  80.  */
  81.  
  82.  
  83. #include <stdio.h>
  84. #include <string.h>
  85.  
  86. extern void nullfunc(char *, ...);
  87. extern void (*diag)(char *, ...);
  88.  
  89. #ifdef _DEBUG_
  90. extern void DebugFunc(char *,...);
  91. extern void _vst_assert_(BOOL, char *, char *,  int);
  92. #endif
  93.  
  94. extern BOOL CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
  95. extern BOOL CALLBACK UserMsgProc(HWND, UINT, WPARAM, LPARAM);
  96. extern BOOL CALLBACK YesNoProc(HWND, UINT, WPARAM, LPARAM);
  97. extern BOOL CALLBACK GetSetProc(HWND, UINT, WPARAM, LPARAM);
  98. extern BOOL CALLBACK ShowSiteProc(HWND, UINT, WPARAM, LPARAM);
  99. extern BOOL CALLBACK ShowSatProc(HWND, UINT, WPARAM, LPARAM);
  100. extern BOOL CALLBACK RTDisplayProc(HWND, UINT, WPARAM, LPARAM);
  101.  
  102. extern POINT *DialogPos(HWND, HWND);
  103. extern int  InitApplication(HANDLE);
  104. extern int  InitInstance(HANDLE, HANDLE, int);
  105. extern int  yesno(char *);
  106. extern int  GetEditText(HWND, int, char *, int);
  107. extern void usermsg(char *);
  108. extern void PaintWindow(void);
  109. extern void InitGraphics(void);
  110. extern void SetScale(void);
  111. extern void MakePen(HDC, int);
  112. extern void MakeBrush(HDC, int);
  113. extern void DestroyObjects(void);
  114. extern void setwsize(HWND, BOOL);
  115. extern void ColorSet(WPARAM, int, int);
  116. extern void RedrawScreen(RECT *);
  117. extern void duration_predict(select_t *);
  118. extern void continuous_display_init(select_t *);
  119. extern void continuous_display_finish(select_t *);
  120. extern void fatal(char *);
  121. extern void xsprintf(va_list,...);
  122. extern void DrawTextStr(HDC, int, int, int, int, int, HFONT, char *, SIZE *);
  123. extern void WaitCursor(void);
  124. extern void NormCursor(void);
  125. extern void setbutton(HWND, int, BOOL);
  126. extern void SetColors();
  127. extern int  rtd_start(HWND, HANDLE, select_t *);
  128. extern void _display_lock(void), _display_unlock(void);
  129. extern BOOL rtd_finish(select_t *);
  130. extern void rtd_update(select_t *);
  131. extern void rtd_init(void);
  132. extern void rtd_delete(void);
  133. extern BOOL rtd_anythread(void);
  134. extern BOOL rtd_allrunning(void);
  135. extern BOOL rtd_allstopped(void);
  136. extern void rtd_allstop(void);
  137. extern void rtd_allresume(void);
  138. extern void rtd_savewindowstate(void);
  139. extern void rtd_restorewindowstate(void);
  140. extern void readactiveDB(void);
  141. extern void saveactivelist(void);
  142. extern char *getline(char *, int, FILE *);
  143. extern void getMode(satellite_t *, int, char *);
  144. extern BOOL setCurrSite(site_t *);
  145. extern void printMode(FILE *, satellite_t *, int);
  146. extern void upperCase(char *);
  147. extern void lowerCase(char *);
  148. extern void shortString(char *, char *);
  149. extern void clipString(char *, int);
  150. extern void stripTrailingSpace(char *);
  151. extern char *stripLeadingSpace(char *);
  152. extern char *saveString(char *);
  153. extern void *safeAlloc(int);
  154. extern void safeFree(void *);
  155. extern int  cistrcmp(char *, char *);
  156. extern void showSatellite(HWND, satellite_t *);
  157. extern void listSatellites(HWND);
  158. extern BOOL UnInstall(int);
  159. extern double getElement(char *, int, int);
  160. extern satellite_t *findSatbyName(char *);
  161. extern satellite_t *findSatbyID(int);
  162. extern int satCompare(const void *, const void *);
  163. extern double reduce(double, double, double);
  164. extern void siderealtime(track_t *, double);
  165. extern void satposSPG4(select_t *, double, double *, double *,
  166.     double *, double *, double *, double *, double *);
  167. extern void params_init(satellite_t *, track_t *);
  168. extern void predict_init(int, select_t *, double);
  169. extern int  predict(int, select_t *, double);
  170. extern select_t *findSelectionbyID(int);
  171. extern select_t *findSelectionbyName(satellite_t *, site_t *);
  172. extern void flagStr(unsigned int, char *);
  173. extern select_t *addSelection(satellite_t *, site_t *, double, double, double,
  174.         double, int, unsigned int);
  175. extern BOOL modifySelectionbyName(HWND, select_t *, satellite_t *, site_t *,
  176.         double, double,  double, double, int, unsigned int);
  177. extern void listSelections(HWND);
  178. extern int deleteSelection(select_t *);
  179.  
  180. extern BOOL init_main(void);
  181. extern void rst(select_t *);
  182.  
  183. extern BOOL GetUserInput(char *, char *, char *, int);
  184. extern BOOL GetKeyValue(char *, char *, int *);
  185. extern select_t *checksat(int, int);
  186.  
  187. extern void getGroundTrack(double ,double ,double *,char *,char *);
  188. extern void showSite(HWND, site_t *);
  189. extern void listSites(HWND);
  190. extern site_t *findSitebyName(char *);
  191. extern site_t *findSitebyID(int);
  192.  
  193. extern BOOL ServerCreate(  exserver_t *, void *);
  194. extern void ServerDestroy(void);
  195. extern void FmtProc(int, int, exserver_t *, select_t *, char *);
  196.  
  197. extern double utctime(void);
  198. extern long   day_number(int, int ,int);
  199. extern void   daytodate(long ,int *, int *, int *, int *);
  200. extern void   printDate(FILE *, double, site_t *, int);
  201. extern void   printTime(FILE *, double, site_t *, unsigned int);
  202. extern void   dateStr(double, site_t *, unsigned int, int, char *);
  203. extern void   dateOnlyStr(double, site_t *, unsigned int, int, char *);
  204. extern void   timeStr(double, site_t *, unsigned int, int, char *);
  205. extern void   durStr(double, char *);
  206. extern void   printMET(FILE *, double);
  207. extern char  *monthname(int);
  208. extern double internalTime(int, int, int, int, int, int);
  209. extern void   timetodhms(double , int *, int *, int *, int *);
  210. extern void   calendar(int, int, int *, int *);
  211. extern double dateStrtoTime(char *);
  212. extern void   *safeAlloc(int);
  213. extern char   *saveString(char *);
  214. extern int    cistrcmp(char *, char *);
  215. extern site_t *findSitebyName(char *);
  216. extern satellite_t *findSatbyName(char *);
  217.  
  218. extern void  *findRotbyModel(char *);
  219. extern void  *findRotbyID(int);
  220. extern void  *findRadbyModel(char *);
  221. extern void  *findRadbyID(int);
  222.  
  223. extern COLORREF DefColors[];
  224. extern HANDLE hInst;                        /* Instance handle                */
  225. extern HANDLE gtr_thread_handle;            /* thread handle of ground track  */
  226. extern HWND Gwnd,rsthwnd;                   /* global copy of the window handles */
  227. extern HANDLE rotph, radph;                 /* Pipe handles for radio and rotator*/
  228. extern HBITMAP hCompatBitmap;               /* handle of copy of screen bitmap*/
  229. extern HBITMAP htBitmap;                    /* handle of bitmap where the cursor piece and dice are*/
  230. extern HDC hCompatDC,htDC;                  /* correspoding DC's for above    */
  231. extern HDC hAppDC, hIconDC;                 /* The window DC, rtd icon DC     */
  232. extern HPEN hDrawPen[];                     /* All the colored pen handles    */
  233. extern HBRUSH hDrawBrush[];                 /* All the colored brush handles  */
  234. extern COLORREF BgColor, FgColor;           /* System Defaults for FG & BG    */
  235. extern COLORREF Colors[];                   /* colors we can use...           */
  236. extern HCURSOR hcurSave;                    /* previous cursor                */
  237. extern HCURSOR hWait;                       /* Hourglass cursor handle        */
  238. extern HFONT hArial,hHelv;                  /* Fonts                          */
  239. extern HICON hVersa;                        /* Main Versatrk icon             */
  240. extern double ScaleX, ScaleY;               /* screen scale factors for drawing*/
  241. extern int npal, ncolor;                    /* # of available colors          */
  242. extern int PenColor;                        /* current pen color              */
  243. extern int BrushColor;                      /* current default brush          */
  244. extern int TextColor;                       /* current text pen color         */
  245. extern int CWhite,CBlack,DefBg,DefFg;       /* index into Colors[]            */
  246. extern int ytop, ybottom;                   /* extra space for text and menu  */
  247. extern int maxx_device, maxy_device;        /* Device resolution              */
  248. extern int maxx_htdc, maxy_htdc;
  249. extern RECT tRect;                          /* text area at bottom of window  */
  250. extern int duration_running, duration_stop, running;
  251. extern int modelflag;
  252. extern int NSats, NSites;
  253. extern mapdata_t mapdata;
  254. extern CRITICAL_SECTION display_mutex;
  255. extern CRITICAL_SECTION sat_mutex;
  256.  
  257. extern double minElevation;
  258. extern double duration;
  259. extern double stepTime;
  260. extern double startTime;
  261. extern double stopTime;
  262. extern double timeZone;
  263.  
  264. extern char   dllname[NAMELEN];
  265. extern char   *dllinvalidmsg;
  266. extern char   *dllloadmsg;
  267. extern char   timeZoneName[9];
  268. extern char   timeZoneHrs[11];
  269. extern char   datadir[96];
  270. extern char   SiteName[64];
  271. extern char   VersionStr[40];
  272. extern char   mapname[16];
  273. extern char   tmpbuf[BUFLEN];
  274. extern char   textbuf[BUFLEN];
  275. extern char   string[BUFLEN];
  276. extern char   satfilename[NAMELEN];
  277. extern char   sitefilename[NAMELEN];
  278. extern char   activefilename[NAMELEN];
  279. extern char   modesfilename[NAMELEN];
  280. extern char   gtrfilename[NAMELEN];
  281. extern char   mapfilename[NAMELEN];
  282. extern char   rotatorfilename[NAMELEN];
  283. extern char   radiofilename[NAMELEN];
  284. extern char   rotpipe[NAMELEN];
  285. extern char   radpipe[NAMELEN];
  286. extern char   dllname[NAMELEN];
  287. extern FILE   *gtrFile;
  288. extern unsigned char EpochString[18];
  289. extern exserver_t  serverInfo[SRV_NUM];
  290.  
  291. extern site_t      **siteInfo;
  292. extern satellite_t **satInfo;
  293. extern select_t     *selInfo;
  294. extern select_t     *currentSel;
  295. extern radinfo_t    *radInfo;
  296. extern rotinfo_t    *rotInfo;
  297.  
  298. #endif /* _VSTEXTRN_H */
  299.